package com.maoshi.shop.distribution.multishop.controller;

import com.maoshi.shop.common.config.Constant;
import com.maoshi.shop.distribution.comment.model.DistributionUser;
import com.maoshi.shop.distribution.comment.service.DistributionUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/distribution/user")
public class DistributionUserController {
    @Autowired
    private DistributionUserService distributionUserService;

    /**
     * 获取信息
     */
    @GetMapping("/getInfo")
    public ResponseEntity<DistributionUser> getByUserIdAndShopId(String userId) {
        Long shopId = Constant.PLATFORM_SHOP_ID;
        DistributionUser distributionUser = distributionUserService.getByUserIdAndShopId(userId, shopId);
        return ResponseEntity.ok(distributionUser);
    }
}
